package main

import "fmt"

func main()  {
	ch := make(chan int, 2)
	for i := 0; i < 10; i++ {
		//fmt.Println("i:", i)
		select {
		case x := <-ch:
			fmt.Println("x:", x) // "0" "2" "4" "6" "8"
		case ch <- i:
			//fmt.Println("c:", i)
		}
	}
}
